package com.huika.dealontop.views;

import android.content.res.Resources;
import android.text.TextUtils;
import android.util.TypedValue;
import android.widget.EditText;

import com.huika.huikalib.utils.StringUtils;

public class Util {

    public static int dpToPx(Resources res, int dp) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, res.getDisplayMetrics());
    }

    public static boolean isEmpty(EditText editText) {
        String text = editText.getText().toString().trim();
        return StringUtils.isEmpty(text);
    }

    public static boolean isTextIdentical(String s, String s1) {
        if (s == null || s1 == null) {
            return false;
        }
        return s.equals(s1);

    }
}
